SPB Git

Repository Public

page.tsx 909 B 23 lines tsx

1import Link from "next/link";2import { PageEditor } from "@/components/admin/PageEditor";3import { PageDangerZone } from "@/components/admin/NewPageForm";4import { docState } from "../../../doc";56export const metadata = { title: "Modifier la page" };78export default async function EditPage({ params }: { params: Promise<{ key: string }> }) {9  const { key } = await params;10  const docKey = `page:${key}`;11  const state = await docState(docKey);12  const draft = state.draft as { system?: boolean; path: string };13  return (14    <>15      <Link href="/admin/pages" className="text-ink-700 mb-3 inline-flex min-h-11 items-center text-sm underline underline-offset-4">16        ← Toutes les pages17      </Link>18      <PageEditor key={docKey} docKey={docKey} initial={state} system={!!draft.system} />19      {!draft.system ? <PageDangerZone docKey={docKey} published={state.published} /> : null}20    </>21  );22}23
Files main
Menu

Theme